package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 * @author hua
 * @since 2022-09-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_product_stock")
public class ProductStockDo extends Model<ProductStockDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("product_id")
    private Long productId;

    @TableField("storage_id")
    private Long storageId;

    /**
     * 收货数量
     */
    @TableField("receive_quantity")
    private Integer receiveQuantity;


    /**
     * 记录当初收了多少良品，不可修改
     */
    @TableField("receive_good_quantity")
    private Integer receiveGoodQuantity;


    /**
     * 可用量
     */
    @TableField("good_quantity")
    private Integer goodQuantity;

    /**
     * 次品量
     */
    @TableField("bad_quantity")
    private Integer badQuantity;

    @TableField("order_id")
    private Long orderId;

    /**
     * 单据类型
     */
    @TableField("order_type")
    private String orderType;

    @TableField("create_time")
    private Date createTime;

    @TableField("create_by")
    private Long createBy;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @TableField("update_by")
    private Long updateBy;

    @TableField("update_time")
    private Date updateTime;

    @TableField("company_id")
    private Long companyId;

//    @TableField("unit_cost")
//    private Double unitCost;

    @TableField("shop_id")
    private Long shopId;




    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
